package cn.iocoder.yudao.module.crossborder.order.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * 跨境电商订单类型枚举
 *
 * @author LHL
 */
@AllArgsConstructor
@Getter
public enum OrderTypeEnum {

    NORMAL(1, "普通订单"),
    PRESALE(2, "预售订单"),
    GROUP_BUY(3, "团购订单"),
    WHOLESALE(4, "批发订单"),
    EXCHANGE(5, "换货订单"),
    ;

    /**
     * 类型值
     */
    private final Integer type;
    
    /**
     * 类型名称
     */
    private final String name;

    public static OrderTypeEnum getByType(Integer type) {
        for (OrderTypeEnum value : values()) {
            if (value.getType().equals(type)) {
                return value;
            }
        }
        return null;
    }

}
